package com.example.wemedia.service.impl;

import com.example.wemedia.dao.WmMaterialMapper;
import com.example.wemedia.service.WmMaterialService;
import com.usian.model.media.pojos.WmMaterial;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

@Service
public class WmMaterialServiceImpl implements WmMaterialService {
    @Autowired
    private WmMaterialMapper wmMaterialMapper;
    @Override
    public Integer saveMasterail(String type,String imgUrl) {
        WmMaterial wmMaterial = new WmMaterial();
        wmMaterial.setCreatedTime(new Date());
        wmMaterial.setUrl(imgUrl);
        wmMaterial.setType(type);
//        wmMaterial.setIsCollection();
        return  wmMaterialMapper.insert(wmMaterial);
    }

}
